[SPARK-22549][SQL] Fix 64KB JVM bytecode limit problem with concat_ws#19777
[SPARK-22549][SQL] Fix 64KB JVM bytecode limit problem with concat_ws#19777kiszk wants to merge 3 commits intoapache:masterfrom
Conversation
|
Test build #83978 has finished for PR 19777 at commit
|
| val varargNum = ctx.freshName("varargNum") | ||
| ctx.addMutableState("int", varargNum, "") | ||
| val idxInVararg = ctx.freshName("idxInVararg") | ||
| ctx.addMutableState("int", idxInVararg, "") |
There was a problem hiding this comment.
can we do better? I think we can avoid these global variables.
There was a problem hiding this comment.
Sure, you are right. Let me do it later.
| """ | ||
| }, | ||
| _.mkString(s"$varargNum += ", s";\n$varargNum += ", ";")) | ||
| val varargBuilds = ctx.splitExpressions(varargBuild, "varargBuildsConcatWs", |
There was a problem hiding this comment.
shall we optimize for eval.isNull == "true" in varargCount and varargBuild? since you already did it for the all string cases.
|
Test build #84030 has finished for PR 19777 at commit
|
|
Test build #84034 has finished for PR 19777 at commit
|
## What changes were proposed in this pull request? This PR changes `concat_ws` code generation to place generated code for expression for arguments into separated methods if these size could be large. This PR resolved the case of `concat_ws` with a lot of argument ## How was this patch tested? Added new test cases into `StringExpressionsSuite` Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Closes #19777 from kiszk/SPARK-22549. (cherry picked from commit 41c6f36) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
thanks, merging to master/2.2! |
## What changes were proposed in this pull request? This PR changes `concat_ws` code generation to place generated code for expression for arguments into separated methods if these size could be large. This PR resolved the case of `concat_ws` with a lot of argument ## How was this patch tested? Added new test cases into `StringExpressionsSuite` Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com> Closes apache#19777 from kiszk/SPARK-22549. (cherry picked from commit 41c6f36) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
| val args = ctx.freshName("args") | ||
|
|
||
| val inputs = strings.zipWithIndex.map { case (eval, index) => | ||
| if (eval.isNull != "true") { |
There was a problem hiding this comment.
@kiszk I was looking at build warnings and it notes that this compares a ExprValue and String and they will always not be equal. Should it be eval.isNull.code != "true" maybe?
What changes were proposed in this pull request?
This PR changes
concat_wscode generation to place generated code for expression for arguments into separated methods if these size could be large.This PR resolved the case of
concat_wswith a lot of argumentHow was this patch tested?
Added new test cases into
StringExpressionsSuite